package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.OrderTradeProcessContractDO;
import com.ssy.lingxi.order.entity.OrderTradeProcessDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * 交易流程规则关联的合同Jpa仓库
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-24
 */
@Repository
public interface OrderTradeProcessContractRepository extends JpaRepository<OrderTradeProcessContractDO, Long>, JpaSpecificationExecutor<OrderTradeProcessContractDO> {
    OrderTradeProcessContractDO findFirstByProcess(OrderTradeProcessDO tradeProcess);

    @Transactional
    void deleteByProcess(OrderTradeProcessDO tradeProcess);
}
